//
//  GoodsLastButtonCell.m
//  FKGW
//
//  Created by song ce on 2017/2/23.
//  Copyright © 2017年 song ce. All rights reserved.
//

#import "GoodsLastButtonCell.h"
#import "AllEvaluationVC.h"
@implementation GoodsLastButtonCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle =UITableViewCellSelectionStyleNone;
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(evaluateType:) name:@"evaluateType" object:nil];
}
-(void)evaluateType:(NSNotification*)noti{
    self.type = noti.object;
}

-(void)setPid:(NSString *)pid{
    _pid = pid;
}
//  查看全部评论
- (IBAction)lookAllEvaluate:(UIButton *)sender {
    AllEvaluationVC *allEvaluate = [[AllEvaluationVC alloc]init];
    allEvaluate.vcName = @"全部评价";
    allEvaluate.pid = _pid;
    allEvaluate.type = self.type;
    [[self secondNavigationController]pushViewController:allEvaluate animated:YES];
}

- (BaseNavigationViewController*)secondNavigationController{
    UIResponder *next = self.nextResponder;
    while (next!=nil) {
        if([next isKindOfClass:[BaseNavigationViewController class]]){
            return (BaseNavigationViewController*)next;
        }
        next = next.nextResponder;
    }
    return nil;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
